package com.lastfm.search;



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

import com.lastfm.handler.HandlerLastFM;

public class Search {

	private StringBuffer result;
	
	public String execute(HandlerLastFM info) throws IOException{
		URL url = info.getUrl("json");
		InputStreamReader in = new InputStreamReader(url.openStream());
		BufferedReader read = new BufferedReader(in);
		
		String temp ;
		StringBuffer buff = new StringBuffer();
		while((temp = read.readLine())!=null){
			buff.append(temp);
		}
		result = buff;
		return buff.toString();
	}
	
	
}
